package com.liyuci.eleon.index;

import com.liyuci.eleon.admin.dept.Dept;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 系统首页
 * @author liyuci
 * @date 2017-10-24 10:19:58
 */
@Controller
@RequestMapping("/")
@Api(tags = {"系统首页"})
public class IndexController 
{
	@ApiOperation(value = "进入系统首页")
	@GetMapping
	public String index()
	{
		return "index";
	}
	
	@ApiOperation(value = "控制面板")
	@GetMapping("main.html")
	public String main(Model model, HttpServletRequest request)
	{
		//request.setAttribute("deptId", "4081a8dc5a74d6f9015a74d6fc0e1111");
		Dept dept = new Dept();
		dept.setName("1111");
		model.addAttribute("deptId", "4081a8dc5a74d6f9015a74d6fc0e1111");
		List<Dept> listDept = new ArrayList<>();
		listDept.add(dept);
		model.addAttribute("listDept", listDept);
		return "main";
	}
}
